package org.jeecg.modules.mapper.printapply;


import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.jeecg.modules.bean.entity.printapply.TbPrintApply;

import java.util.List;

/**
 * @Description: 病历复印申请表
 * @Author: jeecg-boot
 * @Date: 2023-11-29
 * @Version: V1.0
 */
public interface TbPrintApplyMapper extends BaseMapper<TbPrintApply> {

    @Update("update tb_print_apply set status = #{printApply.status} ,applied_by = #{printApply.appliedBy},applied_time = getdate() where id = #{printApply.id}")
    void updateStatusById(@Param("printApply") TbPrintApply printApply);

    IPage<TbPrintApply> getApplyListByItems(Page<TbPrintApply> page, @Param("tbPrintApply") TbPrintApply tbPrintApply,
                                            @Param("startTime") String startTime,@Param("endTime") String endTime);

    /**
     * 查询病历复印申请清单接口
     * @param page
     * @param queryWrapper
     * @return 多表关联sql语句自己写；分页以及条件用mp,返回值是TbPrintApply
     */
    IPage<TbPrintApply> getApplyListPage(Page<TbPrintApply> page, @Param(Constants.WRAPPER) QueryWrapper<TbPrintApply> queryWrapper);
}
